<?php


namespace app\api\validate;


use think\Validate;

class UserValidate extends Validate
{

    protected $rule =   [
        'mobile'       => 'require',
        'code'         => 'require',
        'type'         => 'require|number',
        'bill_type'    => 'require|number',
        'password'     => 'require',
        'newpassword'  => 'require',
        'repassword'   => 'require',
    ];

    protected $message  =   [
        'mobile.require'       => '账号不能为空',
        'code.require'          => '验证码不能为空',
        'type.require'          => 'type不能为空',
        'bill_type.require'     => 'bill_type不能为空',
        'type.number'           => 'type必须是数字',
        'bill_type.number'      => 'bill_type必须是数字',
        'password.require'      => '旧密码不能为空',
        'newpassword.require'   => '新密码不能为空',
        'repassword.require'    => '确认密码不能为空',
    ];

    protected $scene = [
        'wallet_list'     => ['type','bill_type'],
        'update_password' => ['password','repassword'],
        'forget_password' => ['mobile','password','repassword','code'],
        'register'        => ['mobile','password'],
    ];

}